package Helper;

/**
 * Created by Administrator on 2018/1/11 0011.
 */

public class Tools {

    public static String subName(String name){
        if (name != null && !name.equals("")){
            String sub = name.substring(0,1);
            if (name.length()<3){
                for (int i = 0; i < name.length()-1; i++) {
                    sub += "*";
                }
                name = sub;
            }else{
                String pub = name.substring(name.length()-1);
                for (int i = 0; i < name.length()-2; i++) {
                    sub += "*";
                }
                name = sub+pub;
            }
        }
        return name;
    }

}
